package com.ruoyi.crm.controller;


import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.annotation.PreAuthorize;
import com.ruoyi.crm.service.ProductSercvice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private ProductSercvice productSercvice;

    /**
     * 获取产品详情
     */
    @PreAuthorize(hasPermi = "crm:product:querybyname")
    @GetMapping(value = "/info/{productName}")
    public AjaxResult getProductInfoByName(@PathVariable("productName") String productName)
    {
        AjaxResult success = AjaxResult.success(productSercvice.getProductInfoByName(productName));
        return success;
    }
}
